from typing import List
import numpy as np
# 节点类
class Node:
    def __init__(self, 
                label=1,
                x=0.0,
                y=0.0,
                z=0.0):
        self.label = int(label)
        self.x = float(x)
        self.y = float(y)
        self.z = float(z)
    def __str__(self):
        return f"Node {self.label} ({self.x}, {self.y}, {self.z})"
    def __eq__(self,other) -> bool:
        if isinstance(other, Node):
            return self.label == other.label and self.x == other.x and self.y == other.y and self.z == other.z
        else:
            return False
    def __ne__(self, other)-> bool:
        return not self.__eq__(other)
    @property
    def coordinate(self)->np.ndarray:
        """返回坐标数组np.array([x,y,z])"""
        return np.array([self.x,self.y,self.z])
